package com.suray.wcs.service.core.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author caox
 */
@Component
public class SysConfigUtil {

    private Integer noAssignTaskTimeOut;

    private Integer taskCount;

    private boolean preAssignAdjust;

    public static Integer NO_ASSIGN_TASK_TIME_OUT;
    public static Integer TASK_COUNT;
    // 是否调整预分配
    public static boolean PRE_ASSIGN_ADJUST;

    @Value("${suray.rgvTaskAssign.noAssignTaskTimeOut:1800}")
    public void setNoAssignTaskTimeOut(Integer noAssignTaskTimeOut) {
        this.noAssignTaskTimeOut = noAssignTaskTimeOut;
        SysConfigUtil.NO_ASSIGN_TASK_TIME_OUT = noAssignTaskTimeOut;
    }

    @Value("${suray.rgvTaskAssign.taskCount:2}")
    public void setTaskCount(Integer taskCount) {
        this.taskCount = taskCount;
        SysConfigUtil.TASK_COUNT = taskCount;
    }

    @Value("${suray.rgvTaskAssign.preAssign:true}")
    public void setPreAssign(boolean preAssignAdjust) {
        this.preAssignAdjust = preAssignAdjust;
        SysConfigUtil.PRE_ASSIGN_ADJUST = preAssignAdjust;
    }
}
